export default {
  onPageLoad(query) {
    //console.log('---------> LifeCycle onPageLoad', query)
    // 获取系统信息
    const systemInfo = wx.getSystemInfoSync();
    // 胶囊按钮位置信息
    const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
    // 导航栏高度 = 状态栏到胶囊的间距（胶囊距上距离-状态栏高度） * 2 + 胶囊高度 + 状态栏高度
    $page.state.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
    $page.state.menuHeight = menuButtonInfo.height;
  },
  onPageShow() {
    // 获取分类名
    let ct = wx.getStorageSync("currentTab");
    let itemData =  $page.state.listCardData.find( item => item.id == ct)
    $page.state.itemData = itemData.data[0]
  },
  onPageReady() {
    //console.log('---------> LifeCycle onPageReady')
  },
  onPageHide() {
    //console.log('---------> LifeCycle onPageHide')
  },
  onPageUnload() {
    //console.log('---------> LifeCycle onPageUnload')
  },
}